package edu.common;

import lombok.Data;


/**
 * 公共返回类，后端返回统一类型的信息给前端
 * @param <T>
 */
public class CommonResult<T> {
    private Integer code;  // 状态码
    private T data;  // 数据

    public CommonResult(Integer code) {
        this.code = code;
    }

    public CommonResult(Integer code, T data) {
        this.code = code;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
